/**
 * WorkflowUtility.java
 * etks-online-common
 */
package ae.pcfc.etks.online.wf;

import ae.pcfc.etks.online.wf.service.client.vo.CompleteStepVO;

/**
 * @author Dicetek.Ismail
 *
 */
public class WorkflowCommon {
    
	public String cldDeptStepName;
	public String cedDeptStepName;
	public String ehsDeptStepName;
	public String finDeptStepName;

    	public String getCldDeptStepName() {
	    return cldDeptStepName;
	}

	public void setCldDeptStepName(String cldDeptStepName) {
	    this.cldDeptStepName = cldDeptStepName;
	}

	public String getCedDeptStepName() {
	    return cedDeptStepName;
	}

	public void setCedDeptStepName(String cedDeptStepName) {
	    this.cedDeptStepName = cedDeptStepName;
	}

	public String getEhsDeptStepName() {
	    return ehsDeptStepName;
	}

	public void setEhsDeptStepName(String ehsDeptStepName) {
	    this.ehsDeptStepName = ehsDeptStepName;
	}

	public String getFinDeptStepName() {
	    return finDeptStepName;
	}

	public void setFinDeptStepName(String finDeptStepName) {
	    this.finDeptStepName = finDeptStepName;
	}

	/**
	 * Description:
	 * updateCompleteStepVO:	Method to update the CompleteStepVO.
	 * This method sets the approval action [Approved/Rejected] and the customer message in the corresponding department 
	 * @author Dicetek.Ismail
	 * @param	CompleteStepVO - The workflow object which needs to be updated with the action and comments
	 * @param	- String - Step Name
	 * @param	- String - Status
	 * @param	- String - Comment to the Customer
	 */	
	public void updateCompleteStepVO(CompleteStepVO completeStepVO,String strStepName, String status, String comment) {
		
	    if(completeStepVO != null && strStepName != null){
			if(cldDeptStepName.equalsIgnoreCase(strStepName)){
				completeStepVO.setlActionCLD(status);
				completeStepVO.setlCLDCustomerMsg(comment);
			}else if(cedDeptStepName.equalsIgnoreCase(strStepName)){
				completeStepVO.setlActionCED(status);
				completeStepVO.setlCEDCustomerMsg(comment);
			}else if(ehsDeptStepName.equalsIgnoreCase(strStepName)){
				completeStepVO.setlActionEHS(status);
				completeStepVO.setlEHSCustomerMsg(comment);
			}else if(finDeptStepName.equalsIgnoreCase(strStepName)){
				completeStepVO.setlActionFIN(status);
				completeStepVO.setlFINCustomerMsg(comment);
			}
		}
	}
}
